﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Method.Returns.Any.That.Is.GreaterEqual
{
    [TestClass]
    public class ThanAttributeTest
    {
        [Arcana.Contract.Method.Returns.Any.That.Is.GreaterEqual.Than(5)]
        public static int[] Target(int[] x)
        {
            return x;
        }

        [TestMethod]
        [Owner("arcane_master_cp")]
        [WorkItem(55)]
        [ExpectedException(typeof(InvalidOperationException))]
        public void ShouldThrowException()
        {
            Target(new int[] { 1, 2, 3, 4 });
        }

        [TestMethod]
        [Owner("arcane_master_cp")]
        [WorkItem(55)]
        public void ShouldPass()
        {
            Target(new int[] { });
            Target(new int[] { 1, 2, 3, 4, 5 });
            Target(new int[] { 0, 6 });
        }
    }
}
